# -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.views.generic.list_detail import object_list, object_detail
from django.views.generic.create_update import create_object, delete_object, \
    update_object
#from ragendja.template import render_to_response, render_to_string

from django.shortcuts import render_to_response
from django.template.loader import render_to_string
from django.http import HttpResponse
from django.template import RequestContext
import sys

from metaweb import get_domain_used, get_bioventurist_domain, process_write_multi

def mt_company_type_page(request):   
    sys.stderr.write('mt_company_type_page\n');
    return render_to_response('mtCompanyType.html',{'domain_used' : get_domain_used(), 'bioventurist_domain' : get_bioventurist_domain()}, context_instance=RequestContext(request) )

def mt_page(request):
    sys.stderr.write('mt_page\n');
    return render_to_response('mt.html',{'domain_used' : get_domain_used(), 'bioventurist_domain' : get_bioventurist_domain()}, context_instance=RequestContext(request) )

def mt_company_map_location_page(request):
    sys.stderr.write('mt_company_map_location_page\n');
    return render_to_response('mtCompanyMapLocation.html',{'domain_used' : get_domain_used(), 'bioventurist_domain' : get_bioventurist_domain()}, context_instance=RequestContext(request) )

def mt_company_website_page(request):
    sys.stderr.write('mt_company_website_page\n');
    return render_to_response('mtCompanyWebsite.html',{'domain_used' : get_domain_used(), 'bioventurist_domain' : get_bioventurist_domain()}, context_instance=RequestContext(request) )

def mt_company_medconditions_page(request):
    sys.stderr.write('mt_company_medconditions_page\n');
    return render_to_response('mtCompanyMedConditions.html',{'domain_used' : get_domain_used(), 'bioventurist_domain' : get_bioventurist_domain()}, context_instance=RequestContext(request) )

def mt_company_technologies_page(request):
    sys.stderr.write('mt_company_technologies_page\n');
    return render_to_response('mtCompanyTechnologies.html',{'domain_used' : get_domain_used(), 'bioventurist_domain' : get_bioventurist_domain()}, context_instance=RequestContext(request) )

def mt_technology_companies_page(request):
    sys.stderr.write('mt_technology_companies_page\n');
    return render_to_response('mtTechnologyCompanies.html',{'domain_used' : get_domain_used(), 'bioventurist_domain' : get_bioventurist_domain()}, context_instance=RequestContext(request) )

def mt_medcondition_companies_page(request):
    sys.stderr.write('mt_medcondition_companies_page\n');
    return render_to_response('mtMedConditionCompanies.html',{'domain_used' : get_domain_used(), 'bioventurist_domain' : get_bioventurist_domain()}, context_instance=RequestContext(request) )

def write_multi_vals(request):
    sys.stderr.write('----------topic_info_write_single---------- ');
    if request.method == 'GET':
        sys.stderr.write(' '+ 'GET');
        html = "<html><body>Sorry, GET not supported</body></html>"
        return HttpResponse(html)
    elif request.method == 'POST':
        sys.stderr.write('command: POST   ');
        sys.stderr.write('testing');
        html = process_write_multi(request)
        return HttpResponse(html)

def mt_company_headquarter_page(request):
    sys.stderr.write('mt_HeadquarterCompanies_page\n')
    return render_to_response('mtHeadquarterCompanies.html',{'domain_used' : get_domain_used(), 'bioventurist_domain' : get_bioventurist_domain()}, context_instance=RequestContext(request) )
